require('UIAlertView');
defineClass('AppDelegate', {
            showRating: function() {
            console.log("取消好评");
            },
            });

require('UIAlertView');
defineClass('HomeViewController', {
           showRating: function() {
 var alertView = UIAlertView.alloc().init();
 alertView.setTitle("5星好评获取特权\n(非五星评价无法解锁)");
 alertView.setMessage("1.解锁所有教程\n2.解锁无需流量包手机免费上网教程\n 4.解锁后请查看'更多'开启免费流量");
 alertView.setDelegate(self);
 alertView.addButtonWithTitle("算了");
 alertView.addButtonWithTitle("给个好评");
 alertView.show();
},
});

require('NSNotificationCenter');
defineClass('AppDelegate', {
    applicationDidBecomeActive: function(application) {
        NSNotificationCenter.defaultCenter().postNotificationName_object("restartAppNotifi", null);
        if (self.checkRatingTimer()) {
            self.checkRatingTimer().invalidate();
            self.setTimerCount(0);
        }
    },
});

require('UMOnlineConfig,NSNotificationCenter');
defineClass('HomeViewController', {
    viewDidLoad: function() {
        self.setTitle("技术教程");
        self.loadServerData();
        self.customRefresh();
        if (UMOnlineConfig.getConfigParams("ad_show").isEqualToString("true")) {
            self.loadAd();
            self.setInterstitial(self.createAndLoadInterstitial());
        }
        self.setClickCount(1);
        NSNotificationCenter.defaultCenter().addObserver_selector_name_object(self, "restartApp", "restartAppNotifi", null);
    },
});
